package com.insigma.business.qrcode.welfare.dto;


import org.apache.commons.lang3.StringUtils;

public enum ApplicationErrorTypeEnum {
    SERVER_INNER_ERROR("1", "服务器端内部错误"),
    UNAUTHORITY_ERROR("2", "访问权限类错误"),
    PARAM_MISS_ERROR("3", "缺失参数类错误"),
    PARAM_INVALID_ERROR("4", "请求参数校验类错误"),
    BIZ_INVALID_ERROR("5", "业务校验错误");

    private String code;
    private String desc;

    private ApplicationErrorTypeEnum(String code, String description) {
        this.code = code;
        this.desc = description;
    }

    public static ApplicationErrorTypeEnum getByCode(String code) {
        ApplicationErrorTypeEnum[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            ApplicationErrorTypeEnum resultCode = var1[var3];
            if (StringUtils.equals(resultCode.getCode(), code)) {
                return resultCode;
            }
        }

        return null;
    }

    public String getCode() {
        return this.code;
    }

    public String getDesc() {
        return this.desc;
    }
}
